package org.iteam.xlz.manager.action.user;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;
import org.iteam.web.struts.action.AbstractModuleAction;
import org.iteam.web.struts.action.RestAction;
import org.iteam.xlz.core.entity.user.UserAddress;
import org.iteam.xlz.core.service.user.UserAddressService;

@SuppressWarnings("unchecked")
@Results({@Result(name="INDEX",type="freemarker",location="/WEB-INF/content/user/address-index.html")})
public class UserAddressAction extends AbstractModuleAction<UserAddress> implements RestAction{

	/**
	 * 
	 */
	private static final long serialVersionUID = 5550888813095307130L;
	private final String PATH="/user/address";
	
	@Override
	public UserAddress getModel() {
		if(null==model){
			model=new UserAddress();
		}
		return model;
	}

	@Override
	@Action(PATH+"/index")
	public String index() {
		return INDEX;
	}

	@Override
	@Action(PATH+"/query")
	public String query() {
		map.put("total",UserAddressService.getInstance().counts(model.getUid()));
		map.put("rows",UserAddressService.getInstance().query(model.getUid(),page,rows));
		return MAP;
	}

	@Override
	public String create() {
		return null;
	}

	@Override
	public String update() {
		return null;
	}

	@Override
	public String delete() {
		return null;
	}

	@Override
	public String destroy() {
		return null;
	}

	@Override
	public String edit() {
		return null;
	}

	@Override
	public String editNew() {
		return null;
	}

	@Override
	public String show() {
		return null;
	}
	

}
